//
//  CircleStyle.cpp
//  fingeradvanture
//
//  Created by shuaibincheng on 16/5/30.
//
//

#include "CircleStyle.hpp"
#include "Utils.hpp"

MonsterType CircleStyle::next()
{
    if(numOfMonsters % 2 && center == MONSTER_UNKNOWN)
    {
        auto centerTypes = centerAllowedMonsterType();
        center = centerTypes[Utils::random_int(centerTypes.size())];
    }
    if(edge == MONSTER_UNKNOWN)
    {
        auto edgeTypes = edgeAllowedMonsterType();
        edge = edgeTypes[Utils::random_int(edgeTypes.size())];
    }
    if(remaining == 0 && numOfMonsters % 2)
        return center;
    else
        return edge;
    return MONSTER_UNKNOWN;
}

std::vector<MonsterType> CircleStyle::edgeAllowedMonsterType()
{
    std::vector<MonsterType> types;
    types.push_back(MONSTER_2_1);
    //types.push_back(MONSTER_2_2);
    types.push_back(MONSTER_4_1);
    types.push_back(MONSTER_4_2);
    types.push_back(MONSTER_5_1);
    types.push_back(MONSTER_5_2);
    return types;
}

std::vector<MonsterType> CircleStyle::centerAllowedMonsterType()
{
    std::vector<MonsterType> types;
    types.push_back(MONSTER_4);
    types.push_back(MONSTER_5);
    return types;
}